﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;


namespace FeiHongWeb.Admin
{
    public partial class OrderShow : System.Web.UI.Page
    {
        AccessHelp accesshelp = new AccessHelp();
        protected void Page_Load(object sender, EventArgs e)
        {
            if ((this.Session["username"] == null) || (this.Session["username"].ToString() == string.Empty))
            {
                base.Response.Write("<font color=#ff0000 style='FONT-SIZE: 12px'>对不起,您没足够权限访问此页!!</font><br>");
                base.Response.Write("<a href='Login.aspx' target=_top style='FONT-SIZE: 12px'>重新登陆</a><br>");
                base.Response.End();
            }
            if (!IsPostBack)
            {
                base.Response.Write("<script>parent.window.document.getElementById( 'lbl_title').innerHTML='询价信息'; </script>");
                string id = Request.QueryString["id"].ToString().Trim();
                string sql = "select * from [Orders] where Id=" + id + "";
                DataSet ds = accesshelp.getds(sql);
                if (ds.Tables[0] != null && ds.Tables[0].Rows.Count != 0)
                {
                    this.lbl_model.Text = ds.Tables[0].Rows[0]["model"].ToString();
                    this.lbl_address.Text = ds.Tables[0].Rows[0]["address"].ToString();
                    this.lbl_city.Text = ds.Tables[0].Rows[0]["city"].ToString();
                    this.lbl_code.Text = ds.Tables[0].Rows[0]["code"].ToString();
                    this.lbl_company.Text = ds.Tables[0].Rows[0]["person"].ToString();
                    this.lbl_content.Text = ds.Tables[0].Rows[0]["content"].ToString();
                    this.lbl_email.Text = ds.Tables[0].Rows[0]["email"].ToString();
                    this.lbl_fax.Text = ds.Tables[0].Rows[0]["fax"].ToString();
                    this.lbl_national.Text = ds.Tables[0].Rows[0]["national"].ToString();
                    this.lbl_num.Text = ds.Tables[0].Rows[0]["num"].ToString();
                    this.lbl_phone.Text = ds.Tables[0].Rows[0]["phone"].ToString();
                }
            }
        }

        protected void btn_return_Click(object sender, EventArgs e)
        {
            Response.Redirect("OrderList.aspx");
        }
    }
}